<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="hu" xml:lang="hu">
<head>
<?php print $html->charset('utf-8') ?>
<title><?php print $title_for_layout ?></title>
<meta name="generator" content="<?php if(isset($settings)) print $settings['version']; ?>" /> 
<link rel="shortcut icon" href="<?php print $html->url('/favicon.ico'); ?>" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="<?php print $html->url('/css/what2DoBeallitas.css.php'); ?>" />
<?php
print $html->css('what2Do.css?v=100412', 'stylesheet', array('media'=>'screen'));
print $html->css('print.css', 'stylesheet', array('media'=>'print'));
?>
<?php
	//nézetfüggő print fileok betöltése
	/*if(strpos($_SERVER['REQUEST_URI'], 'getHaviTasks'))
		print $html->css('print_havi', 'stylesheet', array('media'=>'print'));*/
?>
<?php print $javascript->link('prototype') ?>

<?php
$loadMindent = false;
if($session->read('User.nev') && $this->params['controller'] == 'tasks' && !strpos($_SERVER['REQUEST_URI'], 'maybe') && !strpos($_SERVER['REQUEST_URI'], 'waiting'))
	$loadMindent = true;
if($loadMindent){
	print $javascript->link('scriptaculous.js');
	print $javascript->link('cookie');
	print $javascript->link('inputmaszk');
	print $javascript->link('what2Do.js?v=101118');
	print $javascript->link('what2Do.beallitas.js');
	}
?>
</head>
<body>
<div id="teljeslap">
	<div id="fejlec">
		<?php
			/*print $html->link(
									$html->image('logot.png', array('title'=>__('Refresh', true))),
									'/',
									array('id' => 'logo'),
									null, false);*/
			if($loadMindent){
				print $html->link(
									$html->image('hide.png', array('title'=>__('Logout', true), 'width' => '22', 'height' => '22')),
									'/users/logout',
									array('id' => 'logout'),
									null, false);
				print '<form action="" method="post" id="searchForm">';
				print $ajax->autoComplete('TaskSearch',
												  '/tasks/search',
												  array(
														  'value' => __('Search', true),
														  'afterUpdateElement' => 'what2Do.whatsNext.villant'
														  )
												  );
				print '</form>';
				print $html->image('wizard.png', array('title'=>__('Most important', true), 'id' => 'wizard'));
				}
			if(isset($w2dfrissites))
				if($w2dfrissites)
					print $html->link($html->image('update.png', array('title'=>__('Update', true))), UPDATEURL, array('target'=>'_blank'), null, false);
			if(isset($security['installFile']))
				if($security['installFile'])
					print $html->link($html->image('warning.png', array('title'=>__('Warning', true))), '/users/change/', null, null, false);
			?>
	</div>

	<div id="tartalom">
		<?php
			print $content_for_layout;
		?>
		<div id="menu">
		<?php
			$m1 = $m2 = $m3 = $m4 = $m5 = $m6 = $m7 = $m8 = array();
			if(strpos($_SERVER['REQUEST_URI'], 'categories'))
				$m2 = array('class'=>'akt');
			elseif(strpos($_SERVER['REQUEST_URI'], 'priorities'))
				$m3 = array('class'=>'akt');
			elseif(strpos($_SERVER['REQUEST_URI'], 'pages/help'))
				$m5 = array('class'=>'akt');
			elseif(strpos($_SERVER['REQUEST_URI'], 'maybe'))
				$m6 = array('class'=>'akt');
			elseif(strpos($_SERVER['REQUEST_URI'], 'waiting'))
				$m7 = array('class'=>'akt');			
			elseif(strpos($_SERVER['REQUEST_URI'], 'tags'))
				$m8 = array('class'=>'akt');			
			elseif(!strpos($_SERVER['REQUEST_URI'], 'login') && !strpos($_SERVER['REQUEST_URI'], 'users'))
				$m1 = array('class'=>'akt');
			if(!strpos($_SERVER['REQUEST_URI'], 'login')){
				print $html->link(__('Tasks', true), '/', $m1);
				print $html->link(__('Categories', true), '/categories/', $m2);
				print $html->link(__('Priorities', true), '/priorities/', $m3);
				print $html->link(__('Help', true), '/pages/help/', $m5);
				print $html->link(__('Maybe', true), '/tasks/maybe/', $m6);
				print $html->link(__('Waiting', true), '/tasks/waiting/', $m7);
				print $html->link(__('Tags', true), '/tags/index', $m8);
				}
		?>
		</div>
	</div>

	<div id="panel" style="display: none;">
		<div id="taskdetails">
			<span><?php print $html->image('hide.png',array('id'=>'closedetails', 'title'=>__('Close', true))); ?></span>
			<img id="ajaxloader" src="./img/ajax-loader.gif" style="display:none;" />
			<div id="uzenet" class="alert" style="display:none;"></div>
			<!--form action="" method="post" style="display: none;"-->
				<?php
				print $form->create('Task', array('action' => null, 'style' => 'display: none;'));
					print '<h3>
						<span id="task_title">' .
							__('Details', true) . $this->data['Task']['task'] .
						'</span>
						</h3>';
				?>
				<div id="gyorseszkozok">
					<?php
						print $html->link($html->image('done.png',array('title'=>__('Done', true), 'class'=> 'gyi', 'id'=>'gydone')),'/tasks/setClosed/0',null,null,false);
						print $html->link($html->image('new.png',array('title'=>__('New branch', true), 'class'=> 'gyi', 'id'=>'gyadd')),'/tasks/add/0',null,null,false);
						print $html->link($html->image('delete.png',array('title'=>__('Delete', true), 'class'=> 'gyi', 'id'=>'gydel')),'/tasks/delete/0',null,null,false);
					?>
				</div>
				<div>
					<span class="b labl">
						<?php print __('Start', true) . ': '; ?>
					</span>
					<span id="task_start"></span>
				</div>
				<div>
					<span class="b labl">
						<?php print __('Overdue points', true) . ': '; ?>
					</span>
					<span id="task_odp"></span>
				</div>
				<div>
					<span class="b labl">
						<?php print __('Path', true) . ': '; ?>
					</span>
					<span id="task_path"></span>
				</div>
				<div>
					<?php print $form->label('categories_id', __('Category', true));?>
				 	<?php echo $form->select('categories_id', $categories, null , array(), array(), false);?>
				</div>
				<div> 
					<?php echo $form->label('priorities_id', __('Priority', true));?>
					<?php echo $form->select('priorities_id', $priorities, null, array(), array(), false);?>
				</div>
				<div> 
					<?php echo $form->label('types_id', __('Type', true));?>
				 	<?php echo $form->select('types_id', $types, null, array(), array(), false);?>
				</div>
				<div> 
					<?php echo $form->label('szulo', __('Parent', true));?>
				 	<?php
					//echo $form->selectTag('Task/szulo', $szulo, null, array(), array(), false);
					print '<select id="TaskSzulo" name="data[Task][szulo]">';
					foreach($szuloTree as $sz){
						if($sz['id'])
							print '<option value="'.$sz['id'].'" id="o'.$sz['id'].'">'.$sz['task'].'</option>' . "\n";
						}
					print '</select>';
					?>
				</div>
				<div> 
				 	<?php echo $form->input(__('Task', true), array(
																	'size' => '60',
																	'type' => 'text',
																	'name' => 'data[Task][task]',
																	'id' => 'TaskTask'
																	)
													);?>
				</div>
				<div> 
					<?php
					print $form->label('Tags', __('Tags', true));
					print $ajax->autoComplete('TaskTags',
												  '/tags/search',
												  array(
														  'afterUpdateElement' => 'what2Do.panel.tagshandler'
														  )
												  );
					?>
					<input id="TaskTag" name="data[Task][tag]" type="hidden">
					<div id="tagsdiv"></div>
				</div>
				<div> 
					<?php //echo $html->labelTag('Task/due', DUE);?>
				 	<?php print $form->input(__('Due', true), array('size' => '60',
																					'type' => 'text',
																					'name' => 'data[Task][due]')); ?>
				</div>
				<div> 
					<?php //echo $html->labelTag( 'Task/details', __('Details', true));?>
					<div id="tdetailsslider" style="height: 230px;"><?php //inline style height kell, mert enélkül csak a két szélső értéket képes felvenni?><?php print $html->image('le.gif', array('id'=>'tdetailsresize')); ?></div>
				 	<?php echo $form->input(__('Details', true), array('type' => 'textarea',
																						'id' => 'tdetails',
																						'name' => 'data[Task][details]'));?>
				</div>
				<?php echo $form->submit(__('Add', true), array('name' => 'submit'));?>
			<?php $form->end(); ?>
		</div>
	</div>
	
	<div id="beallitas" style="display:none;">
		<span><?php print $html->image('hide.png',array('id'=>'closebeallitas', 'title'=>__('Close', true))); ?></span>
		<img id="beallitasAjaxloader" src="./img/ajax-loader.gif" style="display:none;" />
		<div id="beallitasReszletek"></div>
	</div>

	<div id="lablec">
	</div>
</div>
</body>
</html>
